package com.clive.ttweb.service.impl;

import com.clive.ttweb.bean.User;
import com.clive.ttweb.service.UserService;
import com.clive.ttweb.excption.DishException;
import com.clive.ttweb.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User findUserAndPass(User user) {
        User u = userMapper.findUserAndPass(user);
        if (u==null){
            throw new DishException("用户名或密码错误，请重新输入");
        }
        u.setPassWord("");
        return u;
    }
}
